//
//  UIViewController+Add.h
//  PigMarket
//
//  Created by Felix on 2019/3/4.
//  Copyright © 2019 felix.pigmarket.oc. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Response.h"
NS_ASSUME_NONNULL_BEGIN

typedef void(^ErrorDefaultHandling)(void);

typedef void(^ButtonBlock)(void);

@interface UIViewController (Add)

- (void)handlingError:(NSError *)error;
- (void)handlingError:(NSError *)error errorDefaultHandling:(ErrorDefaultHandling)errorDefaultHandling;


/**
 单按钮弹框
 
 @param title title
 @param content content
 @param btnTitle 按钮title
 @param btnBlock centerBtnBlock
 */
- (void)alertViewWithTitle:(NSString *)title
                   content:(NSString *)content
                  btnTitle:(NSString *)btnTitle
                  btnBlock:(nullable ButtonBlock)btnBlock;


/**
 单按钮 自定义view 弹框
 
 @param title title
 @param contentView concontentViewtent
 @param btnTitle 按钮title
 @param btnBlock centerBtnBlock
 */
- (void)alertViewWithTitle:(NSString *)title
               contentView:(UIView *)contentView
                  btnTitle:(NSString *)btnTitle
                  btnBlock:(nullable ButtonBlock )btnBlock;

- (void)toastWithContent:(NSString *)content;
- (void)pushToViewController:(void(^)(void))handler;
@end

NS_ASSUME_NONNULL_END
